﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Rss.aspx.vb" Inherits="Prototype.Rss" ContentType= "text/xml"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        #form1
        {
            font-size: medium;
            font-family: Calibri;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">

         
    <HeaderTemplate>
    <rss version="2.0">
      <channel>
        <title>List of New Books</title>
        <description>
          <strong>List of recently added books</strong>
          <br />
          <br />
        </description>
     </HeaderTemplate>
     
     <ItemTemplate>
     <div>
     <item>
                                                 
            <bname><strong>Name: </strong> <%# DataBinder.Eval(Container.DataItem, "Bookname")%></bname>
            <br />
            <author><strong>Author: </strong><%# (DataBinder.Eval(Container.DataItem, "Author"))%></author>
            <br />
            <series><strong>Series </strong><%# (DataBinder.Eval(Container.DataItem, "Series"))%></series>
            <br /> 
             <asp:HyperLink runat="server" NavigateUrl='<%# Eval("ID", "~/Details.aspx?ID={0}") %>'> Go to Details page
              </asp:HyperLink>
            <br />
                       
                                           
     <hr />

     </item>
     </div>
     </ItemTemplate>


     <FooterTemplate>
      </channel>
    </rss>  
  </FooterTemplate>

        </asp:Repeater>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:booksConn %>" 
            ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
            SelectCommand="SELECT TOP 5 * FROM [books] ORDER BY [ID] DESC">
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
